#ifndef ERROR_NO_GEN_H_
#define ERROR_NO_GEN_H_

#include <string>
#include <vector>
#include <utility>
class ErrorNoGen
{
public:
    struct ErrorInfo
    {
        std::string errorId;
        std::string errorMsg;
        int32_t     errorNo;
    };
public:
    ErrorNoGen() = default;
    ~ErrorNoGen() = default;
    void genFiles(const std::string &fileName);
private:
    bool init(const std::string &fileName);
    std::string genMultiPairErrorString();
    std::string genOnePairErrorString(const std::string &errorId, const int32_t errorNo, const std::string& errorMsg);
    std::string strToUpper(const std::string &str);
    std::string genErrorDefClassString();
    std::string genErrorImplClassString();
    std::string genIncludeString();
    std::string genFileHeaderString();
    std::string genFileFooterString();

private:
    const std::string headFileName = {"error_no_def.h"};
    const std::string cppFileName = {"error_no_def.cpp"};
    std::vector<ErrorInfo> errIdVec = {};
    std::string className = {};
};
#endif